package com.hhl.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.hhl.entity.StudentInfo;


//@RestController表示该接口全部返回json格式
//@RestController
@Controller
public class HelloworldController {

    @RequestMapping("index1")
    public String index(Map<String,Object> dd){
    	dd.put("name","hhl");
    	dd.put("age","18");
        return "index";
    }

    @RequestMapping("getMap")
    public Map<String,Object> getMap(){
        Map<String,Object> map = new HashMap<String,Object>();
        map.put("errorCode","200");
        map.put("errorMsg","SUCCESS");
        return map;
    }

    @RequestMapping("getEntity")
    public StudentInfo getEntity(){
        StudentInfo info = new StudentInfo();
        info.setAge("12");
        info.setName("何海龙");
        info.setSex("男");


        return info;
    }



}
